import email
from email.mime.text import MIMEText
import smtplib

email_body="""
<h align="center">接口自动化测试报告 </h>
<p align="center">详情请见附件</p>
"""
email_text=MIMEText(email_body,'html','utf-8')
email_text['from']= '2428697515@qq.com'
email_text['to']='2428697515@qq.com'
email_text['Cc']='2428697515@qq.com'
email_text['subject']='sunny做的自动化测试报告'

smtp=smtplib.SMTP()
smtp.connect("smtp.qq.com")

smtp.login(user='2428697515@qq.com',password='ixfowsjfvbgcecaf')
smtp.sendmail('2428697515@qq.com','2428697515@qq.com',email_text.as_string())
smtp.close()